-
Notifications
You must be signed in to change notification settings - Fork 742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to pnpm
#3889
Migrate to pnpm
#3889
Conversation
|
Codecov Report
@@ Coverage Diff @@
## main #3889 +/- ##
==========================================
+ Coverage 75.12% 75.14% +0.01%
==========================================
Files 195 195
Lines 11482 11485 +3
Branches 3033 3034 +1
==========================================
+ Hits 8626 8630 +4
+ Misses 2856 2855 -1
|
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6098052926/npm-package-wrangler-3889 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6098052926/npm-package-wrangler-3889 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6098052926/npm-package-wrangler-3889 dev path/to/script.js Additional artifacts:npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6098052926/npm-package-cloudflare-pages-shared-3889 Note that these links will no longer work once the GitHub Actions artifact expires.
| Please ensure constraints are pinned, and |
If you didn't do it, I was going to. It works better for Monorepo's and has other benefits! Looks like Windows making things difficult 😞 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving the concept from Pages' perspective so you're not blocked on us :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming that fixed the Windows test, I am excited to see this go in!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good to me. Thanks for this @penalosa
Co-authored-by: Pete Bacon Darwin <[email protected]>
Overall this looks good to me, but there's a bit of an issue with the c3 e2e tests. This change causes tests to use The package detection code here falls back to npm as the default, which will no longer be the case when this lands. This change should fix it. |
What this PR solves / how to test:
This is a big PR, but it's mostly because of the shift from
npm
'spackage-lock.json
to thepnpm
system. The rest of the PR deals with "phantom" dependencies that various parts of the codebase had—making sure those relationships were spelled out more explicitly.Is
pnpm
worth it, you might ask? I think so. Beyond the raw speed improvements (hello 11s package install times in CI!), it also provides much better dependency isolation, which is starting to become a major problem for us as a large-ish monorepo. An upcoming PR relies on using a different version of React (18) than that used in Wrangler (17), which was tricky (read, "I gave up and switched topnpm
instead") to get working with the npm workspaces install algorithm (React itself was correctly hoisted to the package scope, but other dependencies weren't, leading to components from packages importing React 17 (from Wrangler), not React 18 (from the new package) as they should have done).pnpm
provides a lot more customisability around hoisting, and also has better defaults (hoisting dependencies to the package scope by default).This should change nothing for consumers of the Wrangler package (it'll still be usable from
npm
,yarn
, andpnpm
, as it is currently), but it'll change the workflow for contributors to Wrangler, who will need to switch to usingpnpm
for all installs. To that end, I've made updates to the README to usepnpm
commands (and to specifically call out how to installpnpm
for those who might not already have it installed).In lieu of updating the
wranglerjs-compat-webpack-plugin
package to work withpnpm
, the package has been removed. After team discussion, this package will be deprecated, but the source will continue to be available in the git history, or on thev2-maintenance
branchAuthor has included the following, where applicable:
[ ] Tests[ ] Changeset (Changeset guidelines)Reviewer is to perform the following, as applicable:
Note for PR author:
We want to celebrate and highlight awesome PR review! If you think this PR received a particularly high-caliber review, please assign it the label
highlight pr review
so future reviewers can take inspiration and learn from it.